/*对价格和票数是否相等进行判断
* @Author: Jerry-chen
* @Date:   2014-07-10 02:08:04
* @Last Modified by:   Jerry-chen
* @Last Modified time: 2014-07-15 00:01:40
*/

                $(function(){
                   
                    $('#countticket').focusout(function() {
                    	// alert('dsf');
                        //清除HTML代码
                        $('.mathinfo').empty();
                        //获得CATEID
                         var pricedata = $('#pricedata').val();
                         var ticketdata = $('#countticket').val();
			                 $.ajax({
			                        url: APP + '&c=Goods&m=ajax_countticket',
			                        type: 'post',
			                        dataType: 'json',
			                        data: {'pricedata' : pricedata,'ticketdata' : ticketdata}, 
			                        success:function(data){
			                            //定义属性字符串
			                            var mathinfo = "";
			                            //循环返回的数据
			                            if(data==1){
			                            	mathinfo+="<span>数据填写正确</span>"
			                            }
			                            if(data==0){
			                            	mathinfo+="<span style='color:red;'>数据填写错误</span>"
			                            }
			                     
			                           
			                            
			                            //追加到HTML中
			                            // alert(attr);
			                            $('.mathinfo').append(mathinfo);     
			                      }
                });
		})
})